#pragma once
//#include <bits/stdc++.h>
//#define x first
//#define y second
//#define debug(x) cout<<#x<<":"<<x<<endl;
//using namespace std;
//typedef long double ld;
//typedef long long LL;
//typedef pair<int, int> PII;
//typedef pair<double, double> PDD;
//typedef unsigned long long ULL;
//const int N = 1e5 + 10, M = 2 * N, INF = 0x3f3f3f3f, mod = 1e9 + 7;
//const double eps = 1e-8, pi = acos(-1), inf = 1e20;
//int dx[] = { -1, 0, 1, 0 }, dy[] = { 0, 1, 0, -1 };
//int h[N], e[M], ne[M], w[M], idx;
//void add(int a, int b, int v = 0) {
//    e[idx] = b, w[idx] = v, ne[idx] = h[a], h[a] = idx++;
//}
//int n, m, k;
//int a[N];
//int main() {
//    ios::sync_with_stdio(false), cin.tie(0);
//    int T;
//    cin >> T;
//    while (T--) {
//        cin >> n;
//        string str; cin >> str;
//        LL res = n;
//        for (int i = 1; i < str.size(); i++)
//            if (str[i] != str[i - 1])
//                res += i;
//
//        cout << res << '\n';
//    }
//    return 0;
//}


